<div class="layui-layout layui-layout-admin" style="padding-left: 40px;margin-top: 20px;">
    <form class="layui-form" >
        <div class="text">
            <h2 style = "text-indent:6em"> 
                修改用户【
                <font color="#104E8B" id = "uctrname"></font>
                】的昵称-个性签名
            </h2>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width:100px;">游戏推广号：</label>
 
            <div class="layui-form-mid">
                <font  id = "uctrlinfo"></font>
            </div>
        </div> 
        <div class="layui-form-item">
            <label class="layui-form-label" style="width:100px;">当前昵称：</label>
 
            <div class="layui-form-mid">
                <font  id = "usernickname"></font>
            </div>
        </div> 
        <div class="layui-form-item " >
            <label class="layui-form-label"  style="width:100px;">新昵称：</label>
            <div class="layui-input-inline">
                <input type="text" name="uNewCtrlNickName" id="uNewCtrlNickName" autocomplete="off"  class="layui-input" value="" >
            </div>
        </div>
        <div class="layui-form-item" >
            <label class="layui-form-label"  style="width:100px;">签名：</label>
            <div class="layui-input-block">
                    <textarea style="height:100px;width:400px" name="ctrlreson" id="ctrlreson" placeholder="请输入内容"  class="layui-textarea" maxlength="127"></textarea>
            </div>    
        </div>


        <div class="layui-form-item" >
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit="" lay-filter="useroprater">确定修改</button>
            </div>
        </div>
    </form>
</div>
<script>
var $;
    layui.config({
            base : "js/"
    }).use(['form','element','layer','jquery'],function(){
        var form = layui.form; //只有执行了这一步，部分表单元素才会自动修饰成功
        var $ = layui.jquery;

        ShowContlrDatas();
        form.on('submit(useroprater)', function(data){

            var szDesc = document.getElementById("ctrlreson");
            var uNewCtrlNickName = document.getElementById("uNewCtrlNickName");
           
            var form_data = {
                'uCtrlType': [|.uCtrlType|]
                ,'uCtrlUserID': localStorage["gameid"]
                ,'uCtrNickName': localStorage["unickname"]
                ,'uNewCtrlNickName': uNewCtrlNickName.value
                ,'uNewDes':szDesc.value
                ,'uOldDes':localStorage["oldDes"]
                ,'uCtrlReaSonStr': ""
                }
                layer.confirm('您确定修改：【'+ localStorage["unickname"]+'】的昵称-签名么？', function(index){
                    $.post('[|urlfor "UsersFinduserController.UserContrlInfo"|]', form_data, function (out) {
                        if (out.status == 0) {
                            layer.msg(out.message.strOKMessage,{icon: 1},function () {
                                localStorage["unickname"] = out.message.usernewnickName;
                                window.location.reload()
                            })
                        } else {
                            layer.msg(out.message)
                        }
                    }, "json");
                });
   
       
            return false;
        });
    return false;
}); 
function ShowContlrDatas(){
    var uctrlinfo =  document.getElementById("uctrname");
    uctrlinfo.innerHTML=localStorage["unickname"];
    var datas =  document.getElementById("uctrlinfo");
    datas.innerHTML=localStorage["gameid"];
    var usernickname =  document.getElementById("usernickname");
    usernickname.innerHTML = localStorage["unickname"];
    
}
</script>